//
//  AddCollectCell.m
//  itboye2015002
//
//  Created by boye_mac1 on 15/9/3.
//  Copyright (c) 2015年 Boye. All rights reserved.
//

#import "CollectSkuCell.h"

@implementation CollectSkuCell

- (instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {

        _labelSort = [[UILabel alloc] init];
        _labelSort.frame = CGRectMake(0, 0, (SCREEN_WIDTH - 15 * 4)/3, 30);
        _labelSort.font  = FONT(14);
        _labelSort.textColor = [UIColor darkGrayColor];
        _labelSort.backgroundColor = [UIColor colorWithWhite:0.95 alpha:1];
        _labelSort.textAlignment = NSTextAlignmentCenter;
        _labelSort.layer.masksToBounds = YES;
        _labelSort.layer.cornerRadius = 10;
        [self.contentView addSubview:_labelSort];
        
    }
    return self;
}

// 根据collectionCell的状态改变背景颜色
- (void)showSelectCollectionRow:(SkuCellSelectModel *)selectModel{
    
    UIColor *color;
    UIColor *textColor;

    // 不可选择状态颜色
    if(self.userInteractionEnabled == NO ) {
        // 不可选状态
        color = [UIColor colorWithWhite:0.95 alpha:1];
        textColor = [UIColor colorWithWhite:0.85 alpha:1];
    } else {
        // 选中状态
        if(selectModel.selectRow == self.tag) {
            color = SS_NAVI_ORANGE_COLOR;
            textColor = [UIColor whiteColor];
        } else {
            //正常状态
            color = [UIColor colorWithWhite:0.95 alpha:1];
            textColor = [UIColor darkGrayColor];
        }
   
    }
    
    self.labelSort.backgroundColor = color;
    self.labelSort.textColor = textColor;

}


@end
